#ifndef __SHARK_SHARK_HACK__H__
#define __SHARK_SHARK_HACK__H__

#ifndef BOOST_BIND_ENABLE_STDCALL
#define BOOST_BIND_ENABLE_STDCALL
#endif//BOOST_BIND_ENABLE_STDCALL

#ifndef BOOST_BIND_ENABLE_FASTCALL
#define BOOST_BIND_ENABLE_FASTCALL
#endif//BOOST_BIND_ENABLE_FASTCALL

#include "CoreHook.hpp"
struct CreateWindowExWArgs
{
	DWORD dwExStyle;
	LPCTSTR lpClassName;
	LPCTSTR lpWindowName;
	DWORD dwStyle;
	int x;
	int y;
	int nWidth;
	int nHeight;
	HWND hWndParent;
	HMENU hMenu;
	HINSTANCE hInstance;
	LPVOID lpParam;
};
struct DeferWindowPosArgs
{
	HDWP hWinPosInfo;
	HWND hWnd;
	HWND hWndInsertAfter;
	int x;
	int y;
	int cx;
	int cy;
	UINT uFlags;
};
class Hack : public core::Singleton<Hack>
{
	friend core::Singleton<Hack>;
	enum HotKeyIndex{ ID_SHOW_WINDOW = 0xdeb, };
public:
	Hack()
		: wnd_hanlde_(NULL), list_view_handle_(NULL), dll_handle_(NULL), window_proc_(NULL)
	{}
	~Hack()
	{}
	bool Initialize(HMODULE dll_handle);
	void Finalize();
private:
#define CREATEWINDOWEXW_DECLARE HWND(CreateWindowExWArgs)
	typedef boost::function<CREATEWINDOWEXW_DECLARE> CreateWindowExWInvoker;
	HWND CreateWindowExW(CreateWindowExWInvoker& invoker, CreateWindowExWArgs arg);
#define DEFERWINDOWPOS_DECLARE HDWP(DeferWindowPosArgs)
	typedef boost::function<DEFERWINDOWPOS_DECLARE> DeferWindowPosInvoker;
	HDWP DeferWindowPos(DeferWindowPosInvoker& invoker, DeferWindowPosArgs arg);
#define LOADICONW_DECLARE HICON(HINSTANCE, unsigned int)
	typedef boost::function<LOADICONW_DECLARE> LoadIconWInvoker;
	HICON LoadIconW(LoadIconWInvoker& invoker, HINSTANCE hInstance, unsigned int lpIconName);

public:
	LRESULT WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
	HWND wnd_hanlde_;
	HWND list_view_handle_;
	HINSTANCE dll_handle_;
	WNDPROC window_proc_;
};
#define sHack Hack::GetInstance()
#endif//__SHARK_SHARK_HACK__H__